<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>
<%@ taglib prefix="myfn" uri="/WEB-INF/jstlfun.tld" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<TITLE>创建相册:i友邻社区</TITLE>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/main.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/leftmenu.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/layout.css">
	<link rel="stylesheet" type="text/css" href="${cpath}/css/group.css" />
	
</head>
<body>
<script> 
	//转页面
	var curUserID = '${userID}';
	if((curUserID == "")||(curUserID == null)){
//		parent.window.location.replace("${cpath}/index.jsp"); 
	}
</script>
 	<!-- 页首 {{{ -->
	<%@ include file="/menu.jsp"%>
   
	<div id="mainBody">
	<!-- 左边菜单栏 {{{ -->
	<%@ include file="/leftmenu.jsp"%>

		<DIV id=group>

		<!-- 右侧宽栏 {{{ -->
		<DIV class=group_mid>

			<div class='subtop' >
					<p><a href="${cpath}/qunzu_${theForm.groupID}"><img src="${cpath}/${myfn:getGroupPic(theForm.groupID)}" ></a></p>
				<dl >
					<dt class="tit"><a href="${cpath}/qunzu_${theForm.groupID}">${myfn:getGroupName(theForm.groupID)}</a> &gt; <a >相册维护</a></dt>
					<dd class="intro">&nbsp;</dd>
				</dl>
				<div class='fun'>
					<li><a href="javascript:history.go(-1);">返回上一页</a></li>
				</div>
			</div>
			<DIV class='whole'><!-- 右侧宽栏 }}}-->
				<form action="${cpath}/galbum.do" name="theForm"  method="post" enctype="multipart/form-data" >
					<UL class=detailinfo>
						<LI><STRONG>相册名称:</STRONG><EM>
								<input type="text" name='albumname' value='${theForm.albumname}' maxlength="100" class="long"/></EM></LI>
						<LI><STRONG>说&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;明:</STRONG><EM>
								<textarea name="albuminfo" rows="8" cols="45" >${theForm.albuminfo}</textarea></EM></LI>
						<!--隐藏域-->
						<input type="hidden" name='userID'	 value='${userID}'/>
						<input type="hidden" name='GAlbumID' value='${theForm.GAlbumID}'/>
						<input type="hidden" name='groupID'	 value='${theForm.groupID}'/>
						<input type="hidden" name='delflg'	 value='1'/>
						<input type="hidden" name='name'	 value='fm.jpg'/>
						<input type="hidden" name='folder'	 value='images/'/>
						<input type="hidden" name='action'	 value='${theForm.action}'/>
					</UL><!--结束 }}}-->
					<UL class=detailinfo>
						<li class=btn>	
							<input type="button" name="save"  id="save" onclick="javascript:doConfirm();" class="shortBtn" value="保   存"/>&nbsp;
						</li>
					</UL>
				</form>
			</DIV><!-- whole end }}} -->			

		</DIV><!-- profile_mid }}} -->
		</DIV><!-- group end }}} -->
	<DIV class="clear"></DIV>
	<%@ include file="/indexfoot.jsp"%>
	</DIV><!--mainBody end-->
</body>
</html>
<!---->

<script>

    /**
     * 检查项目资料维护
     */
	function doConfirm()
	{
		var form = document.theForm;
		var albumname = form['albumname'];
		var action = form['action'];

		if(albumname.value == null||albumname.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  	{
			alert('相册名称不能为空');
			albumname.select();
			return ;
		}

    form.submit();
	}

	/**
   * 根据具体请求设置各个组件状态	
   */
  function showState()
	{
		var action = '${theForm.action}';
		var form = document.theForm;		
		if(action == 'detail')
		{
           
			document.getElementById("back").style.display = "none";

		}
		else if(action == 'modifyPage' || action == 'update')
		{

			form['action'].value = 'update';
		}else{

			form['action'].value = 'add';
		}

	}
	showState();


</script>

